<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix='sec' uri='http://www.springframework.org/security/tags'%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="scripts/boot.js"></script>
</head>
<body style="border: 0px; margin: 0px; padding: 0px;width: 100%;height: 100%">
<div class="mini-toolbar" style="border-bottom:0;padding:0px;">
    <table style="width:100%;">
        <tr>
            <td style="width:100%;">
            	<sec:authorize url='/exports_center_orders_info.do'>
            	<a class="mini-button" iconCls="icon-download" onclick="exportAllData()">导出所有</a>
            	</sec:authorize>
            	<span style="color: #f00;">复购率=复购单数/签收单数；退单率=退单金额/(签收金额+退单金额) 不统计离职员工数据</span>
            </td>
             <td style="white-space:nowrap;">
                                           下单开始时间：<input name="startTime"  class="mini-datepicker" style="width: 180px" showClearButton="true" showClose="true" oncloseclick="clearT" allowInput="false"/>
                                           下单结束时间：<input name="endTime" class="mini-datepicker" showClearButton="true" showClose="true" oncloseclick="clearT" style="width: 180px" allowInput="false"/>   
                <a class="mini-button" onclick="search()">查询</a>
            </td>
        </tr>
    </table>        
</div>
<div class="mini-fit" >
	<div id="datagrid0921" class="mini-datagrid" idField="id" pageSize="20" multiSelect="true"
		url="order_center_sta_view.do" style="width:100%;height: 100%" showPager="false">
		<div property="columns">
			<div type="indexcolumn"></div>
			<div field="groupName" width="120" headerAlign="center" align="center">组</div>
			<div field="userName" width="120" headerAlign="center" align="center">用户名</div>
			<div field="name" width="120" headerAlign="center" align="center">登录名</div>
			<div field="newOrder" width="80" headerAlign="center" align="center">新下单数</div>
			<div field="newOrderMoney" width="80" headerAlign="center" align="center">新下单金额</div>
			<div field="complexNumber" width="80" headerAlign="center" align="center">复购数</div>
			<div field="complexMoney" width="80" headerAlign="center" align="center">复购金额</div>
			<div field="complexRate" width="80" headerAlign="center" align="center" numberFormat="p">复购率</div>
			<div field="totalOrdersNumber" width="45" headerAlign="center" align="center">总订单</div>
			<div field="totalMoney" width="45" headerAlign="center" align="center">总金额</div>
			<div field="deliveryNumber" width="80" headerAlign="center" align="center">发货单数</div>
			<div field="backNumber" width="80" headerAlign="center" align="center">退单数</div>
			<div field="backMoney" width="60" headerAlign="center" align="center">退单金额</div>
			<div field="backRate" width="45" headerAlign="center" align="center" numberFormat="p">退单率</div>
			<div field="signNumber" width="80" headerAlign="center" align="center">签收单数</div>
			<div field="signMoney" width="60" headerAlign="center" align="center">签收金额</div>
			<div field="nuclearNumber" width="60" headerAlign="center" align="center">核过单数</div>
			<div field="nuclearMoney" width="60" headerAlign="center" align="center">核过金额</div>
			<div field="cancelNumber" width="60" headerAlign="center" align="center">取消单数</div>
		</div>
	</div>
</div>
<script type="text/javascript">
mini.parse();
var grid = mini.get("datagrid0921");
grid.load();
function search() {
	var startTime = mini.getbyName("startTime").getFormValue();
	var endTime = mini.getbyName("endTime").getFormValue();
	if(startTime == '') {
		alert("开始时间不能为空");
	} else if(endTime == ''){
		alert("结束时间不能为空");
	} else {
		grid.load({startTime: startTime, endTime: endTime});
	}
}

//导出全部
function exportAllData(){
	var startTime = mini.getbyName("startTime").getFormValue();
	var endTime = mini.getbyName("endTime").getFormValue();
	location.href="exports_center_orders_info.do?startTime="+startTime+"&endTime="+endTime; 
}
function clearT(e) {
	e.sender.setValue("");
	e.sender.setText("");
}
</script>
</body>
</html>